#ifndef SERIALSERVER_H
#define SERIALSERVER_H

#include <QWidget>
#include <QStackedWidget>
#include <QButtonGroup>
#include "databases.h"
#include <QSqlTableModel>
#include <QSqlRecord>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QPushButton>
#include <QStringList>
#include <QSqlRelationalTableModel>
#include "login.h"
#include<QTableView>




namespace Ui {
class SerialServer;
}

class SerialServer : public Login
{
    Q_OBJECT
    
public:
    explicit SerialServer(QWidget *parent = nullptr);
    ~SerialServer();

    
private slots:
    void on_saveBtn_clicked();

    void on_addBtn_clicked();

    void on_delBtn_clicked();

    void on_config_addBtn_clicked();

    void on_config_saveBtn_clicked();

    void on_config_delBtn_clicked();

    void on_work_addBtn_clicked();

    void on_work_saveBtn_clicked();

    void on_work_delBtn_clicked();

private:
    void SwitchPage();
    void ConnectFunc();

    //数据库内容写入 TableView 中
    void userinfoShow();

    void configInfo();

    void workInfo();

    void isRoot(QTableView* tab);




    
private:
    Ui::SerialServer *ui;
    QSqlTableModel *loginModel;

    QSqlRelationalTableModel *configModel; //模型

    QSqlRelationalTableModel *workModel;



    
};

#endif // SERIALSERVER_H
